package listbyorder.access301_400.test326;

public class Solution1 {

    // 计算3的幂
    public boolean isPowerOfThree(int n) {
        if (n < 3 || n % 3 != 0) return false;
        if (n == 3) return true;
        return isPowerOfThree(n / 3);
    }
}
